package com.buaa.airticketbookingsystem.Service.UserServiceImpl;

import com.buaa.airticketbookingsystem.Dao.CollectionsDao;
import com.buaa.airticketbookingsystem.Entity.FavouriteRecord;
import com.buaa.airticketbookingsystem.Service.FavouriteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class FavouriteServiceImpl implements FavouriteService {

    @Autowired
    private CollectionsDao collectionsDao;

    @Override
    public List<FavouriteRecord> searchFavouriteRecordsByUser(String user_email) {
        return collectionsDao.searchFavouriteRecordsByUser(user_email);
    }

    @Override
    public void delFavouriteRecords(String user_email, String f_id) {
        collectionsDao.delFavouriteRecords(user_email, f_id);
    }

    @Override
    public void insertFavourite(FavouriteRecord favouriteRecord){
        collectionsDao.insertFavourite(favouriteRecord);
    }

    @Override
    public FavouriteRecord searchFavouriteRecordByEmailAndF_id(String email, String f_id){
        return collectionsDao.searchFavouriteRecordByEmailAndF_id(email, f_id);
    }
}
